$(function () {
    page();
})

function page() {
    $.post("/Mmanufacture.do/MmanufactureWZYCha", {productname:$("#productname").val()}, function (sdata) {
        let str = "     <tr class=\"table-success\">\n" +
            "            <th>派工单编号</th>\n" +
            "            <th>产品编号</th>\n" +
            "            <th>产品名称</th>\n" +
            "            <th>投入数量</th>\n" +
            "            <th>合格数量</th>\n" +
            "            <th>派工单状态</th>\n" +
            "            <th>审核状态</th>\n" +
            "            <th>生产状态</th>\n" +
            "        </tr>\n";
        $.each(sdata, function (index, item) {
            let s= JSON.stringify(item);
            str += "     <tr >\n" +
                "            <td><a href='#' onclick='cha("+s+")'>" + item.manufactureid + "</a> </td>\n" +
                "            <td>" + item.productid + "</td>\n" +
                "            <td>" + item.productname + "</td>\n" +
                "            <td>" + item.amount + "</td>\n" +
                "            <td>" + (item.testedamount==null?'生产中':item.testedamount) + "</td>\n" +
                "            <td>" + ((item.mapplys).manufacturetag=='P001-0'?'等待':'完成')+ "</td>\n" +
                "            <td><span style='font-weight: 600;color:" + (item.checktag == 'S001-2' ? 'red' : item.checktag == 'S001-1' ? 'lime' : '') + "'>" +
                (item.checktag == 'S001-2' ? '不通过' : item.checktag == 'S001-1' ? '通过' : '等待') + "</span></td>\n"+
                "            <td>" + (item.manufactureproceduretag=='S002-2'?'完成':'等待') + "</td>\n"+
                "         </tr>\n";
        })
        $("#tableMFCha").html(str);
    })
}

function cha(op) {
    localStorage.setItem("mManufactureXQCha",JSON.stringify(op));
    location.href="../../wen_zhi_yi/mManufactureXQ.html";
}









